package com.kangye.learnstudent.controller;

import com.kangye.learnstudent.entity.Paper;
import com.kangye.learnstudent.service.PaperService;
import com.kangye.learnstudent.util.ViewJsonObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: learndeduo
 * @description: 试卷请求接口
 * @author: 高天乐
 * @create: 2021-05-17 14:02
 **/
@RestController
@CrossOrigin
@RequestMapping("/paper")
public class PaperController {
    @Autowired
    private PaperService paperService;

    //根据试卷id查询题目id
    @RequestMapping("/selPaper")
    public ViewJsonObject selPaper(Integer paperStudentPaperId){
        return paperService.selPaper(paperStudentPaperId);
    }
    //提交修改学生的答案是否正确 和学生的答案
    @RequestMapping("/updPaper")
    public void updPaper(Paper paper) {
        //调用service方法
        paperService.updPaper(paper);
    }
}
